/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"BE77118A-5B9C-4976-A0A6-00DE91C068E1"}
 */
var fResultado = null;

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"7FFFA7FD-ED32-4F5F-9797-6F43D99B5B82"}
 */
function seleccionaTodos(event) {
	var $fs = gensayo_to_ensayos.ensayos_to_resultados_dtl
	var $cant = databaseManager.getFoundSetCount($fs)
	
	fResultado = null
	
	for (var i = 1 ; i <= $cant ; i++)
	{
		var $rcd = $fs.getRecord(i)
		
		fResultado += $rcd.valor + '\n' 
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"A14B9915-4BE2-452C-AC52-E7D4FC01C833"}
 */
function seleccionaNinguno(event) {
	fResultado = null
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"8AC6FAAC-A4FB-407A-B016-68ABA338C5E2"}
 */
function aceptar(event) {
	if (fResultado == null)
	{
		forms.analisis_cab_tbl.fResultados 	= null
		forms.analisis_cab_tbl.fResultado 	= null
	}
	else
	{
		forms.analisis_cab_tbl.fResultados 	= fResultado.split('\n')
		forms.analisis_cab_tbl.fResultado 	= fResultado
	}
	cancelar()
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} [event] the event that triggered the action
 *
 * @properties={typeid:24,uuid:"0660748C-8E4B-4D97-8227-06E63344E5A8"}
 */
function cancelar(event) {
	var $win = application.getWindow('RESULTADOS')
	$win.hide()
	$win.destroy()
	fResultado = null
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"64C8DC64-BD2F-473B-BA5A-14C22F31BFE7"}
 */
function onShow(firstShow, event) {
	fResultado = forms.analisis_cab_tbl.fResultados.join('\n')
}
